﻿@model Core.Search.SearchResults

@{
    ViewBag.Title = "Search Results";
}

<h1>@ViewBag.Title</h1>


@foreach (var item in Model.Results) {
    
    <div id="search">
    <div class="title">
    <a href="@item.URL">@item.Title</a>
    </div>
    <div class="content">
    @item.Description
    </div>
    <div class="url">
    <a href="@item.URL">@item.URL</a>
    </div>
    </div>
}

<p>About @Model.Count results&nbsp;Page:&nbsp;

@{
    
    int recs = Model.PageSize * 10;
    recs = recs < Model.Count ? recs : Model.Count;
    int pages = (recs / 10) + 1;
    for(int i = 0;i < pages;++i)
    {
        string url = "/Home/Search/?s=" + Server.UrlEncode(Model.SearchText) + "&p=" + (i+1).ToString();
        <text><a href="@url">@(i+1)&nbsp;</a></text>
    }
}
</p>
